<?php
/**
 *
 * User: 梁晓伟  lxw11109@gmail.com
 * Date: 2017-09-15
 * Time: 15:22
 */

namespace App\Models;


use Illuminate\Database\Eloquent\Model;

class Order extends Model
{
    protected $table = 'yc_order';
    protected $primaryKey = 'id';
    protected $guarded = [];
    public $timestamps = false;

    // protected $casts=[
    //   "activityId"=>"int",
    //   "joinNum"=>"int",
    //   "isLive"=>"boolean",
    //   "saleStatus"=>"boolean"
    // ];
    public function orderDetailList()
    {
        return $this->hasMany(new OrderDetail(), 'order_id', 'id')
            ->select('vip_price','order_id','id as orderDetailId','goods_id','name','image','goods_spec_name','num','is_shouhou');
    }
}